package demo

import (
    "fmt"
    "io/ioutil"

    aepapi "gitee.com/dell_software_department/ctwing_sdk/apis/Aep_public_product_management"
)

func QueryPublicByPublicProductId_Demo() {
    resp, err := aepapi.QueryPublicByPublicProductId("dFI1lzE0EN2", "xQcjrfNLvQ", "{}")

    if err != nil {
        fmt.Println("QueryPublicByPublicProductId err:", err)
        return
    }
    fmt.Println("code:", resp.StatusCode, "\nerr:", err)
    bodyStr, err1 := ioutil.ReadAll(resp.Body)
    if err1 != nil {
        fmt.Println("ioutil.ReadAll err:", err1)
        return
    }
    fmt.Println(string(bodyStr))

    defer resp.Body.Close()
}
func QueryPublicByProductId_Demo() {
    resp, err := aepapi.QueryPublicByProductId("dFI1lzE0EN2", "xQcjrfNLvQ", "{}")

    if err != nil {
        fmt.Println("QueryPublicByProductId err:", err)
        return
    }
    fmt.Println("code:", resp.StatusCode, "\nerr:", err)
    bodyStr, err1 := ioutil.ReadAll(resp.Body)
    if err1 != nil {
        fmt.Println("ioutil.ReadAll err:", err1)
        return
    }
    fmt.Println(string(bodyStr))

    defer resp.Body.Close()
}
func InstantiateProduct_Demo() {
    resp, err := aepapi.InstantiateProduct("dFI1lzE0EN2", "xQcjrfNLvQ", "{}")

    if err != nil {
        fmt.Println("InstantiateProduct err:", err)
        return
    }
    fmt.Println("code:", resp.StatusCode, "\nerr:", err)
    bodyStr, err1 := ioutil.ReadAll(resp.Body)
    if err1 != nil {
        fmt.Println("ioutil.ReadAll err:", err1)
        return
    }
    fmt.Println(string(bodyStr))

    defer resp.Body.Close()
}
func QueryAllPublicProductList_Demo() {
    resp, err := aepapi.QueryAllPublicProductList("dFI1lzE0EN2", "xQcjrfNLvQ", "", "", "")

    if err != nil {
        fmt.Println("QueryAllPublicProductList err:", err)
        return
    }
    fmt.Println("code:", resp.StatusCode, "\nerr:", err)
    bodyStr, err1 := ioutil.ReadAll(resp.Body)
    if err1 != nil {
        fmt.Println("ioutil.ReadAll err:", err1)
        return
    }
    fmt.Println(string(bodyStr))

    defer resp.Body.Close()
}
func QueryMyPublicProductList_Demo() {
    resp, err := aepapi.QueryMyPublicProductList("dFI1lzE0EN2", "xQcjrfNLvQ", "", "", "", "")

    if err != nil {
        fmt.Println("QueryMyPublicProductList err:", err)
        return
    }
    fmt.Println("code:", resp.StatusCode, "\nerr:", err)
    bodyStr, err1 := ioutil.ReadAll(resp.Body)
    if err1 != nil {
        fmt.Println("ioutil.ReadAll err:", err1)
        return
    }
    fmt.Println(string(bodyStr))

    defer resp.Body.Close()
}
